﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>支付宝即时到账接口-直付宝</title>
<meta name="Keywords" content="支付宝即时到账接口，财付通即时到账接口，支付宝担保交易接口" >
<meta name="Description" content="我们提供支付宝即时到账接口，财付通即时到账接口，支付宝担保交易接口，0门槛" >
<script language="javascript" src="jquery-1.5.2.min.js"></script>
</head>
<body>
<style>
li{ list-style:none;}
p{ font-weight:bold;}
</style>
<script>
function savepayinfo(){
	var email=$("#email").val();
	var key=$("#key").val();
    var partner=$("#partner").val();
$.post(
	   "conn.php",
  {
    email:email,
    key:key,
	partner:partner
  },
  function(data,status){
	if(data=="ok")
	{
    	alert("保存成功");
	}
  });



	}
	
	
	function savelist(){
		var title=$("#title").val();
		var payAmount=$("#payAmount").val();
		if(payAmount<1){alert("金额不能小于1元");return false;}
		$.post(
				   "zfupay/zfupay.php",
			  {
				title:title,
				payAmount:payAmount
			  },
			  function(data,status){
					//alert(data);
			  });
			
			
			
				}
		
</script>
<?php
require_once 'zfupay/zfupay.config.php';
$title=createtrsno();
$optEmail=getemail();
$balance=getbalance();
?>
<div>
<!--<p>余额:<?php echo $balance;?>元</p>
<hr>-->
<p>账户设置</p>
<ul>
	<li>支付宝账户:<input type="text" name="email" id="email">
	<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key:<input type="text" name="key" id="key" value="">
	<li>合作者伙伴ID:<input type="text" name="partner" id="partner" value="">
	<input type="button" value="保存" onClick="savepayinfo()"><span id="message"></span></li>
</ul>
<hr>
<p>充值测试</p>
<form name="form1" action="https://shenghuo.alipay.com/send/payment/submit.htm"  methd="post" target="_blank" onSubmit="savelist()">
<input type="hidden" name="title" id="title"  value="<?php echo $title;?>">
<input type="hidden" name="optEmail" value="<?php echo $optEmail;?>">
<ul>
	<li>金额<input type="text" id="payAmount" name="payAmount" value="1">
	<input type="submit" value="充值"></li>
</ul>
</form>
<hr>
<p>充值记录</p>
<table border="1">
	<tr>
    	<td>序号</td>
		<td width="113">交易时间</td>
		<td>交易号</td>
		<td>支付方式</td>
		<td>状态</td>
		<td>金额</td>
	</tr>
<?php 
$conn=getconn();
$result=mysql_query("select * from test_orderlist order by id desc");

while($row=mysql_fetch_row($result)){
	echo "<tr>";
	echo "<td>".$row[0]."</td>";
	echo "<td>".$row[1]."</td>";
	echo "<td>".$row[2]."</td>";
	echo "<td>".$row[3]."</td>";
	echo "<td>".$row[4]."</td>";
	echo "<td>".$row[5]."</td>";
	echo "</tr>";

}	

mysql_close($conn);
?>
</table>
</div>
</body>
</html>